package day_05;

import java.util.Scanner;

/**
 * @ClassName Day05Homework_10
 * @Description TODO
 * @Author hp
 * @Date 2021/6/7 18:02
 * @Version 1.0
 **/
public class Day05Homework_10 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入本组人数:");
        int num = scanner.nextInt();
        String[] names = new String[num];
        for (int i = 0; i < names.length; i++) {
            System.out.println("请输入第" + (i+1) + "个人的姓名:");
            names[i] = scanner.next();
        }
        System.out.print("请输入你要查找的姓名:");
        String name = scanner.next();
        for (int i = 0; i < names.length; i++) {
            if(names[i].equals(name)){
                System.out.println(i);
            }
        }
    }

}
